/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.companhia.model;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

/**
 *
 * @author Priscila
 */
@Entity
@Table(name="limpeza")
@PrimaryKeyJoinColumn(name = "id_funcionario")
public class Limpeza extends Funcionario{
    
    @Column(name="jornada_trabalho")
    private int jornadaTrabalho;
    
    @Column
    private String cargo;
    
    @OneToMany (mappedBy="gerente")
    private List<Limpeza> funcsLimpeza;
    
    @ManyToOne
    @JoinColumn(name = "id_gerente")
    private Limpeza gerente;

    public Limpeza() {
        funcsLimpeza = new ArrayList <>();
    }

    public int getJornadaTrabalho() {
        return jornadaTrabalho;
    }

    public void setJornadaTrabalho(int jornadaTrabalho) {
        this.jornadaTrabalho = jornadaTrabalho;
    }

    public String getCargo() {
        return cargo;
    }

    public void setCargo(String cargo) {
        this.cargo = cargo;
    }

    public List<Limpeza> getFuncsLimpeza() {
        return funcsLimpeza;
    }

    public void setFuncsLimpeza(List<Limpeza> funcsLimpeza) {
        this.funcsLimpeza = funcsLimpeza;
    }

    public Limpeza getGerente() {
        return gerente;
    }

    public void setGerente(Limpeza gerente) {
        this.gerente = gerente;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + this.jornadaTrabalho;
        hash = 97 * hash + Objects.hashCode(this.cargo);
        hash = 97 * hash + Objects.hashCode(this.funcsLimpeza);
        hash = 97 * hash + Objects.hashCode(this.gerente);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Limpeza other = (Limpeza) obj;
        if (this.jornadaTrabalho != other.jornadaTrabalho) {
            return false;
        }
        if (!Objects.equals(this.cargo, other.cargo)) {
            return false;
        }
        if (!Objects.equals(this.funcsLimpeza, other.funcsLimpeza)) {
            return false;
        }
        if (!Objects.equals(this.gerente, other.gerente)) {
            return false;
        }
        return true;
    }
    
    
}
